# 导入:

from UserModel import UserModel
from ElectronicAssetModel import ElectronicAssetModel
from util import session,engine
from datetime import datetime
if __name__ == '__main__':

    # Base.metadata.create_all(engine)

    # 创建新User对象:
    # new_user = UserModel()
    new_asset = ElectronicAssetModel()
    new_asset.production_date = datetime.now()
    # 添加到session:
    session.add(new_asset)
    # 提交即保存到数据库:
    session.commit()
    # 关闭session:
    session.close()